# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1512+1.1217.4.15 -> 1.1513 # arch/i386/kernel/process.c 1.51.1.6 -> 1.57 # include/asm-ppc64/page.h 1.19.1.1 -> 1.22 # fs/select.c 1.20.1.1 -> 1.22 # include/linux/mm.h 1.121.1.12 -> 1.127 # include/linux/init.h 1.26.1.1 -> 1.28 # drivers/serial/8250.c 1.34.1.6 -> 1.36 # include/asm-ppc64/processor.h 1.30.1.2 -> 1.33 # include/asm-sparc/unistd.h 1.20.1.6 -> 1.26 # kernel/fork.c 1.124.1.20 -> 1.132 # include/linux/sched.h 1.151.1.19 -> 1.162 # net/sunrpc/svcsock.c 1.62 -> 1.63 # kernel/sys.c 1.43.1.20 -> 1.52 # kernel/sysctl.c 1.46.1.9 -> 1.52 # arch/ppc64/kernel/chrp_setup.c 1.29.1.2 -> 1.33 # arch/ppc64/kernel/rtas.c 1.11.1.1 -> 1.14 # drivers/char/drm/r128_cce.c 1.12.1.3 -> 1.16 # drivers/char/drm/drm_memory_debug.h 1.1.1.4 -> 1.5 # include/asm-sparc64/unistd.h 1.19.1.6 -> 1.25 # arch/i386/kernel/traps.c 1.52.1.8 -> 1.58 # drivers/char/drm/drm_memory.h 1.8.1.6 -> 1.13 # arch/i386/kernel/Makefile 1.44.1.8 -> 1.50 # drivers/char/drm/radeon_cp.c 1.20.1.1 -> 1.22 # include/asm-ppc/pgtable.h 1.23.1.3 -> 1.26 # include/asm-ppc/thread_info.h 1.7.1.3 -> 1.11 # kernel/time.c 1.11.1.6 -> 1.18 # kernel/softirq.c 1.39.1.8 -> 1.44 # arch/ppc/kernel/module.c 1.9.1.1 -> 1.11 # drivers/char/drm/i810_dma.c 1.26.1.4 -> 1.31 # include/linux/nfs_fs.h 1.45.1.6 -> 1.49 # mm/swap.c 1.52.1.1 -> 1.55 # drivers/acpi/tables.c 1.14.1.2 -> 1.17 # arch/ppc64/kernel/irq.c 1.30.1.3 -> 1.33 # drivers/acpi/pci_irq.c 1.16.1.6 -> 1.23 # mm/memory.c 1.123.1.16 -> 1.134 # include/linux/moduleparam.h 1.3.1.1 -> 1.5 # arch/ppc64/kernel/setup.c 1.28.1.3 -> 1.32 # include/linux/pci.h 1.90.1.18 -> 1.98 # arch/ia64/kernel/process.c 1.39.1.7 -> 1.47 # drivers/serial/Makefile 1.14.1.6 -> 1.22 # drivers/char/mem.c 1.42.1.2 -> 1.45 # kernel/posix-timers.c 1.19.1.2 -> 1.22 # arch/ppc64/kernel/head.S 1.36.1.2 -> 1.39 # include/linux/sysctl.h 1.47.1.5 -> 1.52 # arch/ppc64/kernel/xics.c 1.25.1.3 -> 1.28 # arch/ppc64/kernel/htab.c 1.34.1.2 -> 1.37 # arch/ppc64/mm/init.c 1.46.1.6 -> 1.53 # arch/ppc64/kernel/process.c 1.35.1.6 -> 1.40 # mm/mmap.c 1.85.1.7 -> 1.90 # fs/proc/base.c 1.42.1.17 -> 1.51 # arch/sparc64/kernel/module.c 1.14.1.2 -> 1.16 # include/asm-i386/unistd.h 1.25.1.5 -> 1.31 # arch/ppc64/kernel/asm-offsets.c 1.14.1.1 -> 1.17 # Makefile 1.410.1.25 -> 1.422 # fs/fcntl.c 1.28.1.3 -> 1.31 # include/asm-x86_64/unistd.h 1.14.1.4 -> 1.20 # include/asm-ppc64/mmu.h 1.7.1.1 -> 1.10 # arch/ppc64/mm/numa.c 1.7.1.3 -> 1.10 # drivers/char/agp/backend.c 1.83.1.7 -> 1.87 # arch/ppc64/kernel/syscalls.c 1.11.1.2 -> 1.15 # arch/ppc64/kernel/sys_ppc32.c 1.66.1.4 -> 1.68 # kernel/module.c 1.86.1.7 -> 1.93 # include/asm-x86_64/pgtable.h 1.21.1.2 -> 1.24 # arch/ppc64/kernel/smp.c 1.40.1.2 -> 1.43 # drivers/char/drm/drmP.h 1.23.1.6 -> 1.28 # include/asm-i386/pgtable.h 1.35.1.3 -> 1.39 # net/ipv4/tcp_input.c 1.39.1.7 -> 1.44 # arch/ppc64/mm/fault.c 1.10.1.2 -> 1.14 # mm/slab.c 1.93.1.14 -> 1.100 # kernel/sched.c 1.193.1.27 -> 1.203 # drivers/char/agp/hp-agp.c 1.24.1.3 -> 1.30 # arch/alpha/kernel/traps.c 1.24.1.3 -> 1.28 # drivers/char/drm/drm_drv.h 1.20.1.5 -> 1.25 # kernel/timer.c 1.59.1.9 -> 1.68 # arch/ppc64/xmon/xmon.c 1.26.1.3 -> 1.30 # include/asm-m68k/pgtable.h 1.8.1.1 -> 1.10 # arch/s390/kernel/module.c 1.8.1.2 -> 1.11 # arch/arm/kernel/process.c 1.28.1.4 -> 1.31 # drivers/serial/Kconfig 1.8.1.11 -> 1.17 # drivers/char/drm/gamma_dma.c 1.12.1.4 -> 1.16 # include/asm-arm/unistd.h 1.16.1.2 -> 1.20 # arch/ia64/Kconfig 1.38.1.8 -> 1.44 # include/asm-ppc64/pgtable.h 1.23.1.2 -> 1.25 # include/asm-ppc64/mmzone.h 1.11.1.2 -> 1.14 # include/asm-ppc64/topology.h 1.8.1.1 -> 1.10 # include/asm-ppc64/rtas.h 1.6.1.1 -> 1.9 # kernel/printk.c 1.25.1.3 -> 1.30 # arch/ppc64/kernel/ioctl32.c 1.35.1.3 -> 1.39 # drivers/scsi/qla1280.c 1.38.1.12 -> 1.43 # arch/ppc64/kernel/pSeries_lpar.c 1.21.1.1 -> 1.24 # include/asm-s390/unistd.h 1.16.1.1 -> 1.19 # arch/parisc/kernel/module.c 1.5.1.3 -> 1.8 # drivers/scsi/sym53c8xx_2/sym_glue.c 1.23.1.15 -> 1.29 # diff -Nru a/arch/ia64/Kconfig b/arch/ia64/Kconfig --- a/arch/ia64/Kconfig Sat Oct 11 00:44:58 2003 +++ b/arch/ia64/Kconfig Sat Oct 11 00:44:58 2003 @@ -637,6 +637,33 @@ keys are documented in . Don't say Y unless you really know what this hack does. +config IA64_EARLY_PRINTK + bool "Early printk support" + depends on DEBUG_KERNEL && !IA64_GENERIC + help + Selecting this option uses the VGA screen or serial console for + printk() output before the consoles are initialised. It is useful + for debugging problems early in the boot process, but only if you + have a suitable VGA/serial console attached. If you're unsure, + select N. + +config IA64_EARLY_PRINTK_UART + bool "Early printk on MMIO serial port" + depends on IA64_EARLY_PRINTK + +config IA64_EARLY_PRINTK_UART_BASE + hex "UART MMIO base address" + depends on IA64_EARLY_PRINTK_UART + default "ff5e0000" + +config IA64_EARLY_PRINTK_VGA + bool "Early printk on VGA" + depends on IA64_EARLY_PRINTK + +config IA64_EARLY_PRINTK_SGI_SN + bool "Early printk on SGI SN serial console" + depends on IA64_EARLY_PRINTK && (IA64_GENERIC || IA64_SGI_SN2) + config DEBUG_SLAB bool "Debug memory allocations" depends on DEBUG_KERNEL diff -Nru a/drivers/acpi/tables.c b/drivers/acpi/tables.c --- a/drivers/acpi/tables.c Sat Oct 11 00:44:58 2003 +++ b/drivers/acpi/tables.c Sat Oct 11 00:44:58 2003 @@ -262,10 +262,17 @@ /* Map the DSDT header via the pointer in the FADT */ if (id == ACPI_DSDT) { - struct acpi_table_fadt *fadt = (struct acpi_table_fadt *) *header; + struct fadt_descriptor_rev2 *fadt = (struct fadt_descriptor_rev2 *) *header; + + if (fadt->header.revision == 3 && fadt->Xdsdt) { + *header = (void *) __acpi_map_table(fadt->Xdsdt, + sizeof(struct acpi_table_header)); + } else if (fadt->V1_dsdt) { + *header = (void *) __acpi_map_table(fadt->V1_dsdt, + sizeof(struct acpi_table_header)); + } else + *header = 0; - *header = (void *) __acpi_map_table(fadt->dsdt_addr, - sizeof(struct acpi_table_header)); if (!*header) { printk(KERN_WARNING PREFIX "Unable to map DSDT\n"); return -ENODEV; diff -Nru a/include/linux/moduleparam.h b/include/linux/moduleparam.h --- a/include/linux/moduleparam.h Sat Oct 11 00:44:58 2003 +++ b/include/linux/moduleparam.h Sat Oct 11 00:44:58 2003 @@ -52,6 +52,7 @@ #define __module_param_call(prefix, name, set, get, arg, perm) \ static char __param_str_##name[] __initdata = prefix #name; \ static struct kernel_param const __param_##name \ + __attribute_used__ \ __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ = { __param_str_##name, perm, set, get, arg } diff -Nru a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h --- a/include/linux/nfs_fs.h Sat Oct 11 00:44:58 2003 +++ b/include/linux/nfs_fs.h Sat Oct 11 00:44:58 2003 @@ -403,7 +403,7 @@ nfs_size_to_loff_t(__u64 size) { loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; - if (size > maxsz) + if (size > (__u64) maxsz) return maxsz; return (loff_t) size; } diff -Nru a/include/linux/sysctl.h b/include/linux/sysctl.h --- a/include/linux/sysctl.h Sat Oct 11 00:44:58 2003 +++ b/include/linux/sysctl.h Sat Oct 11 00:44:58 2003 @@ -127,6 +127,7 @@ KERN_PANIC_ON_OOPS=57, /* int: whether we will panic on an oops */ KERN_HPPA_PWRSW=58, /* int: hppa soft-power enable */ KERN_HPPA_UNALIGNED=59, /* int: hppa unaligned-trap enable */ + KERN_CACHEDECAYTICKS=60,/* ulong: value for cache_decay_ticks (EXPERIMENTAL!) */ }; diff -Nru a/kernel/printk.c b/kernel/printk.c --- a/kernel/printk.c Sat Oct 11 00:44:58 2003 +++ b/kernel/printk.c Sat Oct 11 00:44:58 2003 @@ -361,6 +361,12 @@ __call_console_drivers(start, end); } } +#ifdef CONFIG_IA64_EARLY_PRINTK + if (!console_drivers) { + void early_printk (const char *str, size_t len); + early_printk(&LOG_BUF(start), end - start); + } +#endif } /* @@ -678,7 +684,11 @@ * for us. */ spin_lock_irqsave(&logbuf_lock, flags); +#ifdef CONFIG_IA64_EARLY_PRINTK + con_start = log_end; +#else con_start = log_start; +#endif spin_unlock_irqrestore(&logbuf_lock, flags); } release_console_sem(); @@ -731,3 +741,117 @@ tty->driver->write(tty, 0, msg, strlen(msg)); return; } + +#ifdef CONFIG_IA64_EARLY_PRINTK + +#include + +# ifdef CONFIG_IA64_EARLY_PRINTK_VGA + + +#define VGABASE ((char *)0xc0000000000b8000) +#define VGALINES 24 +#define VGACOLS 80 + +static int current_ypos = VGALINES, current_xpos = 0; + +static void +early_printk_vga (const char *str, size_t len) +{ + char c; + int i, k, j; + + while (len-- > 0) { + c = *str++; + if (current_ypos >= VGALINES) { + /* scroll 1 line up */ + for (k = 1, j = 0; k < VGALINES; k++, j++) { + for (i = 0; i < VGACOLS; i++) { + writew(readw(VGABASE + 2*(VGACOLS*k + i)), + VGABASE + 2*(VGACOLS*j + i)); + } + } + for (i = 0; i < VGACOLS; i++) { + writew(0x720, VGABASE + 2*(VGACOLS*j + i)); + } + current_ypos = VGALINES-1; + } + if (c == '\n') { + current_xpos = 0; + current_ypos++; + } else if (c != '\r') { + writew(((0x7 << 8) | (unsigned short) c), + VGABASE + 2*(VGACOLS*current_ypos + current_xpos++)); + if (current_xpos >= VGACOLS) { + current_xpos = 0; + current_ypos++; + } + } + } +} + +# endif /* CONFIG_IA64_EARLY_PRINTK_VGA */ + +# ifdef CONFIG_IA64_EARLY_PRINTK_UART + +#include +#include + +static void early_printk_uart(const char *str, size_t len) +{ + static char *uart = NULL; + unsigned long uart_base; + char c; + + if (!uart) { + uart_base = 0; +# ifdef CONFIG_SERIAL_8250_HCDP + { + extern unsigned long hcdp_early_uart(void); + uart_base = hcdp_early_uart(); + } +# endif +# if CONFIG_IA64_EARLY_PRINTK_UART_BASE + if (!uart_base) + uart_base = CONFIG_IA64_EARLY_PRINTK_UART_BASE; +# endif + if (!uart_base) + return; + + uart = ioremap(uart_base, 64); + if (!uart) + return; + } + + while (len-- > 0) { + c = *str++; + while ((readb(uart + UART_LSR) & UART_LSR_TEMT) == 0) + cpu_relax(); /* spin */ + + writeb(c, uart + UART_TX); + + if (c == '\n') + writeb('\r', uart + UART_TX); + } +} + +# endif /* CONFIG_IA64_EARLY_PRINTK_UART */ + +#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN +extern int early_printk_sn_sal(const char *str, int len); +#endif + +void early_printk(const char *str, size_t len) +{ +#ifdef CONFIG_IA64_EARLY_PRINTK_UART + early_printk_uart(str, len); +#endif +#ifdef CONFIG_IA64_EARLY_PRINTK_VGA + early_printk_vga(str, len); +#endif +#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN + early_printk_sn_sal(str, len); +#endif +} + +#endif /* CONFIG_IA64_EARLY_PRINTK */ diff -Nru a/kernel/sysctl.c b/kernel/sysctl.c --- a/kernel/sysctl.c Sat Oct 11 00:44:58 2003 +++ b/kernel/sysctl.c Sat Oct 11 00:44:58 2003 @@ -579,6 +579,16 @@ .mode = 0644, .proc_handler = &proc_dointvec, }, +#ifdef CONFIG_SMP + { + .ctl_name = KERN_CACHEDECAYTICKS, + .procname = "cache_decay_ticks", + .data = &cache_decay_ticks, + .maxlen = sizeof(cache_decay_ticks), + .mode = 0644, + .proc_handler = &proc_doulongvec_minmax, + }, +#endif { .ctl_name = 0 } }; diff -Nru a/mm/memory.c b/mm/memory.c --- a/mm/memory.c Sat Oct 11 00:44:58 2003 +++ b/mm/memory.c Sat Oct 11 00:44:58 2003 @@ -121,8 +121,10 @@ } pmd = pmd_offset(dir, 0); pgd_clear(dir); - for (j = 0; j < PTRS_PER_PMD ; j++) + for (j = 0; j < PTRS_PER_PMD ; j++) { + prefetchw(pmd + j + PREFETCH_STRIDE/sizeof(*pmd)); free_one_pmd(tlb, pmd+j); + } pmd_free_tlb(tlb, pmd); }